//It can help user to init thier code-house 

#include <iostream>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fstream>
using namespace std;

bool scavenger(string& name);

//It can call nother functions to init code-house  
void init_center(){
    string filename = "init.ccw";
    if( scavenger(filename) ){
       
        cout << "\033[36m" << "CCW: Your code-house was already." << "\033[0m" << endl;
        return;
    }
    else{
    char *filename_c = "init.ccw";
    FILE *fileinit;
    fileinit = fopen(filename_c,"a+");
    fclose(fileinit);
    cout << "\033[36m" << "CCW: Okay!Your code-house is init now!" << "\033[0m" << endl;
    cout << "\033[36m" << "CCW: To write code for changing the world!" << "\033[0m" << endl;
    }
}

//To judge if there is already the designated file
bool scavenger(string& name){
    struct stat buffer;
    return (stat(name.c_str(), &buffer) == 0);
}


